package com.ygp.dtp.common.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.List;

/**
 * @description: 动态线程池主配置
 * @motto: 代码源于生活，高于生活艺术
 * @author: zhouhengzhe
 * @date: 2022/8/4 17:47
 * @snce 1.0
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class DynamicThreadPoolMainProperty {
    private static final List<Field> FIELD_NAMES;

    static {
        FIELD_NAMES = Arrays.asList(DynamicThreadPoolMainProperty.class.getDeclaredFields());
    }

    private String dtpName;

    private int corePoolSize;

    private int maxPoolSize;

    private long keepAliveTime;

    private String queueType;

    private int queueCapacity;

    private String rejectType;

    private boolean allowCoreThreadTimeOut;

    public static List<Field> getMainProps() {
        return FIELD_NAMES;
    }
}
